1. Field of the Invention
The present invention relates to a method for reading a table of contents, and more particularly, to a method for preventing a reading error of a table of contents in a multi-session disc.
2. Description of the Prior Art
When an optical disk drive starts up, it has to read the table of contents (TOC) in the lead-in areas on the disc and save the TOC in the memory of the optical disk drive. In this way, the optical disc drive is capable of obtaining the locations of tracks on the disc according to the information stored in the memory. The information stored in the memory can be an index for the optical disk drive to read data on the disc.
Please refer to FIG. 1. FIG. 1 is a diagram of a multi-session disk 100. Each session 20, 30 or 40 comprises a lead in area, a program area, and a lead out area. For example, session 20 comprises its lead in area 22, program area 24, and lead out area 26; session 30 comprises its lead in area 32, program area 34, and lead out area 36; and session 40 comprises its lead in area 42, program area 44, and lead out area 46. Each of the program areas 24, 34 and 44 may be divided into a plurality of tracks for storing data. The TOCs are stored in the lead-in areas 22, 32 and 42 recording the information of all tracks in the sessions 20, 30 and 40. When the optical disk drive starts up, it is able to read data on specific tracks after the TOCs stored in the lead-in areas 22, 32 and 42 have been read sequentially. Generally, the length of the lead-in area of each session is 1 minute, the length of the lead-out area of the first session is 1 minute and 30 seconds, and the length of the lead-out area of each session other than the first session is 30 seconds.
The TOCs are stored in Q channels of lead-in areas. Please refer to FIG. 2. FIG. 2 is a constituent of a Q code representing specific track information or a special information. There are many sets of Q codes repeatedly appear in a lead in area and each set of Q codes represents the whole information of the session. There is no needed for the optical disc drive to read all sets of Q codes. It is enough to obtain the whole information of the session if the optical disc drive is capable of capturing one set of Q codes. The following statement describes some items of a Q code.
The value in a “POINT” item is within the range from 01 to 99 in most of the cases. For example, if the value in the “POINT” item of a Q code is N, it is the data of the Nth track stored in this Q code. The values in the “MIN” item, the “SEC” item, and the “FRAME” item together present the absolute time of the location of the Q code. And the values in the “PMIN” item, the “PSEC” item, and the“PFRAME” item together present the starting location of the Nth track.
However, when the value in the “POINT” item is beyond the range from 01 to 99, the meanings represented by the values in other items are then changed. For instance, if the value in the “POINT” item of one Q code is A0, the values in the “MIN” item, the “SEC” item, and the “FRAME” item still represent the absolute time of the location of the Q code, but the value in the “PMIN” item represents the track number of the first track in this session. If the value in the “POINT” item is A1, the values in the “MIN” item, the “SEC” item, and the “FRAME” item still represent the absolute time of the location of the Q code, but the value in the “PMIN” item represents the track number of the last track in this session. If the value in the “POINT” item is B0, the values in the “MIN” item, the “SEC” item, and the “FRAME” item together represent the starting location of the program area of the next session. Notice that when the value in the “POINT” item is B0, we are not able to know the absolute time of the location of present Q code. Since the values in the “MIN” item, the “SEC” item, and the “FRAME” item represent the starting location of the program area of the next session, the location of the lead-in area of the next session is obtained by subtracting 1 from the value recorded in the “MIN” item simply.
When loading a multi-session disk, the optical disk drive has to read the information of all tracks stored in the TOCs in all sessions sequentially. The optical disk drive needs to obtain the Q code having a “POINT” item of B0, and then drive the optical read/write head to move to the lead-in area of the next session according to the values in the “MIN” item, the “SEC” item and the “FRAME” item of the Q code. When the TOCs in all sessions are all saved into the memory, the process of starting up is then finished completely.
Please refer to FIG. 3. FIG. 3 is a flowchart of a prior art optical disk drive reading the TOCs.
Step 310: Read the two Q codes of which the values in the “POINT” item are A0 and A1, and determine the total amount of tracks and the track numbers in the session according to the value in the “PMIN” item of the two Q codes;
Step 320: Read Q codes of all track numbers;
Step 330: If the Q code of which the values in the “POINT” item is B0 can be read, go to Step 340; if not, go to Step 350;
Step 340: Drive the optical read/write head to move to the lead-in area of the next session according to the values in the “MIN” item, the “SEC” item, and the “FRAME” item of the Q code of which the value in the “POINT” item is B0; go to step 310;
Step 350: End.
When the optical read/write head reads the TOC in the lead-in area in a specific session, the Q codes having “POINT” items of A0 and A1 have to be read first, and the amount of tracks and track numbers in this session are obtained accordingly. For example, if the values in the “PMIN” item of the Q codes having “POINT” items of A0 and A1 are 05 and 08, the amount of tracks are 4 in this session and the track numbers are 5, 6, 7 and 8 sequentially. In consequence, the optical disk drive is capable of recording the values in the “PMIN” item, the “PSEC” item and the “PFRAME” item of the Q codes of which the values in the “POINT” item are 05, 06, 07 and 08 respectively.
Then the optical disk drive attempts to read the Q code having a “POINT” item of B0. If the Q code can be read, the optical disk drive drives the optical read/write head to jump to the lead-in session of the next session according to the values in the “MIN” item, the “SEC” item and the “FRAME” item, and continues reading the TOC in the session. If the Q code cannot be read, it means the session is the last session, and the process of starting up the optical disk drive can be finished accordingly.
However, in the prior art, the absolute time of the location of the Q code having a “POINT” item of B0 is not indicated. Hence when the optical disk drive reads the Q code having a “POINT” item of B0, it is not able to determine whether this Q code is located at the lead-in area of the same session as the Q code that was received before. That means that when the optical disk drive reads the Q code in the TOC of the lead-in area of the first session, it is possible that the optical read/write head jumps to the lead-in area of the second session due to some external force. Therefore, in the second session, the optical read/write head may read the Q code having a “POINT” item of B0. If the optical disk drive drives the optical read/write head to jump to the lead-in area of the next session and reads the TOC according to the values in the “MIN” item, “SEC” item and “FRAME” item, it is unable to save all information of all tracks in its memory, and hence the process of starting up fails.